<template>
    <div class="app" style="border: 3px solid #000; margin: 10px">
        我是APP组件
        <!-- 1.给组件标签，添加属性方式 赋值 -->
        <SonComponent :title="myTitle" @changeTitle="handleChange"></SonComponent>
    </div>
</template>

<script>
import SonComponent from "@/components/SonComponent.vue"

export default {
    name: "App",
    components: {
        SonComponent,
    },
    data() {
        return {
            myTitle: "学前端，就来黑马程序员",
        }
    },
    methods: {
        handleChange(newTitle) {
            this.myTitle = newTitle
        }
    }
}
</script>

<style></style>